<form action="" class="form-horizontal" role="form">

	<div class="form-group">
		<label class="col-sm-2 control-label">广告位类别</label>
		<div class="col-sm-3">
			<input type="text" class="form-control" name="rule" placeholder="" datatype="*" />
		</div>
	</div>
	
	<div class="form-group">
	    <label class="col-sm-2 control-label">广告类型</label>
	    <div class="col-sm-2">
	    	<select class="form-control" id="type-select" name="ad_type" datatype="*">{$adPosition.ad_type}</select>
	    </div>
	</div>
	
	<!-- 文本 -->
	<div class="form-group" id="type-text">
		<label class="col-sm-2 control-label">文本广告内容</label>
		<div class="col-sm-4 reply-txt">
			<textarea class="form-control" name="text" rows="5" id="txtContent"></textarea>
			<div class="form-control" id="content" contenteditable="true"></div>
			<a class="icon-emtion" id="icon-emtion" href="javascript:void(0)"></a>
		</div>
	</div>
	
	<!-- 图文 -->
	<div class="form-group" id="type-news" style="display:none;">
		<label class="col-sm-2 control-label">图文广告内容</label>
		<div class="col-sm-5">
			<div id="news-result">
				<ul class="news-edit-lists">
				</ul>
			</div>
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">广告状态</label>
	    <div class="col-sm-2 radio">
	    	<label class="radio-inline">{$adPosition.status}</label>
	    </div>
	</div>
	
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
		    <input type="hidden" name="news" id="news-id" value="" />
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/addPost">保存更改</button>
		</div>
	</div>
</form>

<!-- 图文素材列表 -->
<section id="news">
	<ul class="news-lists" id="news-lists"></ul>
</section>

<script type="text/javascript">
	var news_data = {};
</script>
<script type="text/javascript" src="__PUBLIC__/Style/My/Default/js/getNewsLists.js"></script>
<script type="text/javascript">
	$(function(){
		$("#type-select").on("change", function(){
			var sel = $(this).val();
			if(sel == "text"){
				$("#type-news").hide();
				$("#type-text").show();
			}else if(sel == "news"){
				$("#type-text").hide();
				$("#type-news").show();
				$("#news").show();
				$MoveTools.init();
			}
		});

	});
</script>